﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TjZheng.WeiXin.DataEntity;

namespace TjZheng.WeiXin.SDK.Pay
{
    public class WxPayProcessContext : WeiXinProcessContext
    {
        /// <summary>
        /// 商户信息
        /// </summary>
        public MerchantInfo MerchantInfo { get; private set; }
        /// <summary>
        /// 设置商户信息
        /// </summary>
        /// <param name="objMerchantInfo"></param>
        public void SetMerchantInfo(MerchantInfo objMerchantInfo)
        {
            if (objMerchantInfo == null)
            {
                throw new WxPayException("WxPayProcessContext.MerchantInfo");
            }
            this.MerchantInfo = objMerchantInfo;
        }
        public void CheckMerchantInfo()
        {
            if (this.MerchantInfo == null)
            {
                throw new WxPayException("WxPayProcessContext.MerchantInfo");
            }
        }
        /// <summary>
        /// Post数据包信息
        /// </summary>
        public WxPayPackage IntputWxPayPackage { get; private set; }
        public void SetIntputWxPayPackage(WxPayPackage objIntputWxPayPackage)
        {
            if (objIntputWxPayPackage == null)
            {
                throw new WxPayException("WxPayProcessContext.IntputWxPayPackage");
            }
            this.IntputWxPayPackage = objIntputWxPayPackage;
        }
        /// <summary>
        /// 检测Post数据包信息
        /// </summary>
        public void CheckIntputWxPayPackage()
        {
            if (this.IntputWxPayPackage == null)
            {
                throw new WxPayException("WxPayProcessContext.IntputWxPayPackage");
            }
        }
        /// <summary>
        ///返回数据包信息
        /// </summary>
        public WxPayPackage OutputWxPayPackage { get; set; }
        /// <summary>
        /// 检测统一下单返回数据包信息
        /// </summary>
        public void CheckOutputWxPayPackage()
        {
            if (this.OutputWxPayPackage == null)
            {
                throw new WxPayException("WxPayProcessContext.OutputWxPayPackage");
            }
        }
    }
}
